<ui:composition template="/template/twocolumn2.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:define name="conteudo">
        <h3>lista de turmas</h3>
        <h:form id="form">
         <p:messages id="messages" showDetail="false" autoUpdate="true" closable="true" />  
            
            <p:dataTable value="#{turmaMB.turmas}" var="turma"
                paginator="false" rows="10" id="dtDisciplina"
                paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks}
                    {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                rowsPerPageTemplate="5,10,15" style="width: 100%" lazy="true">

                <p:column>
                    <f:facet name="header">#{Message['label.global.nome']}</f:facet>
                    <h:outputText value="#{turma.nome}" />
                </p:column>
                <p:column>
                    <f:facet name="header">#{Message['label.turma.semestre']}</f:facet>
                    <h:outputText value="#{turma.semestre}" />
                </p:column>
                <p:column>
                         <f:facet name="header">#{Message['label.global.status']}</f:facet>
                         <h:outputText value="#{turma.statusDescricao.valor}" />
                </p:column>
                <p:column>
                         <f:facet name="header">#{Message['label.turma.qtd.disciplinas']}</f:facet>
                         <h:outputText value="#{turma.disciplinas.size()}" />
                </p:column>
                 <p:column>
                         <f:facet name="header">#{Message['label.turma.qtd.alunos']}</f:facet>
                         <h:outputText value="#{turma.alunos.size()}" />
                </p:column>
                <p:column style="width:4%">
                    <p:commandButton id="selectButton" action="#{turmaMB.paginaAlterarTurma}" 
                    value="Editar" title="View">
                        <f:setPropertyActionListener value="#{turma}" target="#{turmaMB.turma}" />
                    </p:commandButton>
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>
